package com.wetao.lib_common.greendao.model;

import com.wetao.lib_common.greendao.dao.AssistantExamOnlineDao;
import com.wetao.lib_common.greendao.dao.AssistantQuestionOnlineDao;
import com.wetao.lib_common.greendao.dao.DaoSession;
import com.wetao.lib_common.greendao.dao.PagePictureOnlineDao;

import org.greenrobot.greendao.DaoException;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.NotNull;
import org.greenrobot.greendao.annotation.ToMany;

import java.util.List;

@Entity
public class AssistantExamOnline {
    @Id(autoincrement = true)
    private Long id;
    //试卷id
    @NotNull
    private Integer publishId;
    //试卷名称
    private String examName;
    //布置id
    private Integer examId;

    private String studentId;

    private String beginTime; //自己管理
    private String finishTime; //自己管理

    private Integer totalNum; //总数
    private Integer dealNum; //已作答

    private String tempAnswer;//临时答案
    private String tempTimer;//临时答题时间

    @ToMany(referencedJoinProperty = "assistantExamId")
    List<AssistantQuestionOnline> questionList;

    @ToMany(referencedJoinProperty = "assistantExamId")
    List<PagePictureOnline> pagePictureList;
    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;
    /** Used for active entity operations. */
    @Generated(hash = 1107783201)
    private transient AssistantExamOnlineDao myDao;



    @Generated(hash = 1095500887)
    public AssistantExamOnline(Long id, @NotNull Integer publishId, String examName, Integer examId,
            String studentId, String beginTime, String finishTime, Integer totalNum, Integer dealNum,
            String tempAnswer, String tempTimer) {
        this.id = id;
        this.publishId = publishId;
        this.examName = examName;
        this.examId = examId;
        this.studentId = studentId;
        this.beginTime = beginTime;
        this.finishTime = finishTime;
        this.totalNum = totalNum;
        this.dealNum = dealNum;
        this.tempAnswer = tempAnswer;
        this.tempTimer = tempTimer;
    }

    @Generated(hash = 2123763705)
    public AssistantExamOnline() {
    }

  

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getPublishId() {
        return this.publishId;
    }

    public void setPublishId(Integer publishId) {
        this.publishId = publishId;
    }

    public String getExamName() {
        return this.examName;
    }

    public void setExamName(String examName) {
        this.examName = examName;
    }

    public Integer getExamId() {
        return this.examId;
    }

    public void setExamId(Integer examId) {
        this.examId = examId;
    }

    public String getStudentId() {
        return this.studentId;
    }

    public void setStudentId(String studentId) {
        this.studentId = studentId;
    }

    public String getBeginTime() {
        return this.beginTime;
    }

    public void setBeginTime(String beginTime) {
        this.beginTime = beginTime;
    }

    public String getFinishTime() {
        return this.finishTime;
    }

    public void setFinishTime(String finishTime) {
        this.finishTime = finishTime;
    }

    public Integer getTotalNum() {
        return this.totalNum;
    }

    public void setTotalNum(Integer totalNum) {
        this.totalNum = totalNum;
    }

    public Integer getDealNum() {
        return this.dealNum;
    }

    public void setDealNum(Integer dealNum) {
        this.dealNum = dealNum;
    }

    /**
     * To-many relationship, resolved on first access (and after reset).
     * Changes to to-many relations are not persisted, make changes to the target entity.
     */
    @Generated(hash = 1989086689)
    public List<AssistantQuestionOnline> getQuestionList() {
        if (questionList == null) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            AssistantQuestionOnlineDao targetDao = daoSession
                    .getAssistantQuestionOnlineDao();
            List<AssistantQuestionOnline> questionListNew = targetDao
                    ._queryAssistantExamOnline_QuestionList(id);
            synchronized (this) {
                if (questionList == null) {
                    questionList = questionListNew;
                }
            }
        }
        return questionList;
    }

    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    @Generated(hash = 1378007343)
    public synchronized void resetQuestionList() {
        questionList = null;
    }

    /**
     * To-many relationship, resolved on first access (and after reset).
     * Changes to to-many relations are not persisted, make changes to the target entity.
     */
    @Generated(hash = 1690202658)
    public List<PagePictureOnline> getPagePictureList() {
        if (pagePictureList == null) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            PagePictureOnlineDao targetDao = daoSession.getPagePictureOnlineDao();
            List<PagePictureOnline> pagePictureListNew = targetDao
                    ._queryAssistantExamOnline_PagePictureList(id);
            synchronized (this) {
                if (pagePictureList == null) {
                    pagePictureList = pagePictureListNew;
                }
            }
        }
        return pagePictureList;
    }

    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    @Generated(hash = 923295425)
    public synchronized void resetPagePictureList() {
        pagePictureList = null;
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1028607676)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getAssistantExamOnlineDao() : null;
    }

    public String getTempAnswer() {
        return this.tempAnswer;
    }

    public void setTempAnswer(String tempAnswer) {
        this.tempAnswer = tempAnswer;
    }

    public String getTempTimer() {
        return this.tempTimer;
    }

    public void setTempTimer(String tempTimer) {
        this.tempTimer = tempTimer;
    }


}
